Skip to content

Comments

MINIFICPP-2724 C API small changes#2113

Open
martinzink wants to merge 2 commits intoapache:mainfrom
martinzink:small_api_refactor
Open

MINIFICPP-2724 C API small changes#2113
martinzink wants to merge 2 commits intoapache:mainfrom
martinzink:small_api_refactor

Conversation

@martinzink
Copy link
Member

Added MinifiStatus return to MinifiProcessSessionTransfer, MinifiProcessSessionRemove, MinifiFlowFileSetAttribute,
since these might(or might in the future) fail I think its best if we could signal failure back to the extensions.

Removed MinifiProcessContextGetProcessorName since it was only used in the parseProperty helper function so they can include the ProcessorName in the exception message, but these calls are already try-d and any failure logged with the processor name already included so we can further reduce the API


Thank you for submitting a contribution to Apache NiFi - MiNiFi C++.

In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:

For all changes:

  • Is there a JIRA ticket associated with this PR? Is it referenced
    in the commit message?

  • Does your PR title start with MINIFICPP-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.

  • Has your PR been rebased against the latest commit within the target branch (typically main)?

  • Is your initial contribution a single, squashed commit?

For code changes:

  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE file?
  • If applicable, have you updated the NOTICE file?

For documentation related changes:

  • Have you ensured that format looks appropriate for the output in which it is rendered?

Note:

Please ensure that once the PR is submitted, you check GitHub Actions CI results for build issues and submit an update to your PR as soon as possible.

@martinzink martinzink requested review from adamdebreceni and Copilot and removed request for Copilot February 20, 2026 11:20
@martinzink martinzink added this to the minifi-rust milestone Feb 20, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes improvements to the MiNiFi C API to better support error handling and simplify the API surface. The changes enable C extensions to detect and handle failures in session operations that could previously fail silently.

Changes:

  • Modified three C API functions (MinifiProcessSessionTransfer, MinifiProcessSessionRemove, MinifiFlowFileSetAttribute) to return MinifiStatus instead of void for error signaling
  • Removed MinifiProcessContextGetProcessorName from the C API as it was redundant with existing logging
  • Updated error message formatting across the codebase to exclude processor names (which are already included in exception logging context)

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
minifi-api/minifi-c-api.def Removed MinifiProcessContextGetProcessorName export
minifi-api/include/minifi-c/minifi-c.h Updated function signatures to return MinifiStatus, removed MinifiProcessContextGetProcessorName declaration
libminifi/src/minifi-c.cpp Implemented status returns with exception handling for transfer/remove/setAttribute operations, removed getProcessorName implementation
extension-framework/cpp-extension-lib/src/core/ProcessSession.cpp Updated C++ wrappers to check status codes and throw exceptions on failure
extension-framework/cpp-extension-lib/src/core/ProcessContext.cpp Removed getProcessorName method implementation
extension-framework/cpp-extension-lib/include/api/core/ProcessContext.h Removed getProcessorName method declaration
extension-framework/include/utils/ProcessorConfigUtils.h Removed processor name from error message formatting
extension-framework/cpp-extension-lib/include/api/utils/ProcessorConfigUtils.h Removed processor name from error message formatting
extensions/standard-processors/tests/unit/*.cpp Updated test expectations to match new error message format without processor names
extensions/mqtt/tests/*.cpp Updated test expectations to match new error message format without processor names
extensions/llamacpp/tests/*.cpp Updated test expectations to match new error message format without processor names
extensions/azure/tests/*.cpp Updated test expectations to match new error message format without processor names

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants